package com.soup.bytebuddy.advice;

import com.soup.bytebuddy.advice.targets.Cooker;
import net.bytebuddy.asm.Advice;

/**
 * 〈一句话功能简述〉<br>
 *
 * @author zhaoyi
 * @date 2021-04-12 21:50
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
public class AdviceLogic {

    @Advice.OnMethodEnter
    public static void onMethodEnter(){
        System.out.println("- - - - - - enter！ - - - - -");
    }

    @Advice.OnMethodExit
    public static void onMethodExit(@Advice.This Object thiz){
        Cooker cooker = (Cooker) thiz;
        cooker.hello();
        System.out.println(thiz);
        System.out.println("- - - - - - exit！ - - - - -");
        System.out.println();
    }
}
